package com.bra.view;

import java.util.ArrayList;
import java.util.List;

import android.content.Context;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.GridView;
import android.widget.RelativeLayout;
import android.widget.TextView;
import cn.trinea.android.view.autoscrollviewpager.AutoScrollViewPager;

import com.bra.R;
import com.bra.lunbo.CarouselPageAdapter;
import com.bra.lunbo.CirclePageIndicator;
import com.bra.lunbo.MainPage;
import com.bra.ui.adapter.Topic_gv_adapter;
import com.bra.ui.base.PlayFrameLayout;
/**
 * 运动圈view
 * @author lenovo
 *
 */
public class SportsCircleFramelayout extends PlayFrameLayout {
	private GridView topic_gv;
	private Topic_gv_adapter adapter;
	private List<String> datas;

	public SportsCircleFramelayout(Context context, AttributeSet attrs,
			int defStyleAttr) {
		super(context, attrs, defStyleAttr);
		// TODO Auto-generated constructor stub
	}

	public SportsCircleFramelayout(Context context, AttributeSet attrs) {
		super(context, attrs);
		// TODO Auto-generated constructor stub
	}

	public SportsCircleFramelayout(Context context) {
		super(context);
		initview(context);
	}

	public void initview(Context context) {
		LayoutInflater mInflater = LayoutInflater.from(context);
	    View view=mInflater.inflate(R.layout.sportscircle_layout, null);
	    topic_gv=(GridView) view.findViewById(R.id.topic_gv);
	    datas=new ArrayList<String>();
	    for(int i=0;i<=7;i++){
	    	datas.add("篮球"+i);
	    }
	    if(adapter==null){
	    	adapter=new Topic_gv_adapter(context,datas);
	    }
	    topic_gv.setAdapter(adapter);
	   
	 //   adapter.setData(datas);
	 //   adapter.notifyDataSetChanged();
		addView(view);
	}
}
